<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        <table>
            <thead>
            <tr>
                <th>id</th>
                <th>name</th>
                <th>remark</th>
                <th>createdTime</th>
            </tr>
            </thead>
            <tbody id="tbodyId">
                <tr>
                    <td colspan="4">数据不见啦~</td>
                </tr>
            </tbody>
        </table>
    </div>
<script src="js/axios.min.js"></script>
<script>
    window.onload = function(){
        axios.get("http://localhost:8081/goods/findGoods").then(
            function(result){
                //document.write(result.data);

                var body = document.getElementById("tbodyId");
                body.innerHTML="";
                result.data.forEach(function(item){
                    let tr = document.createElement("tr");
                    let td = document.createElement("td");
                    td.innerText=item.id;
                    tr.appendChild(td);

                    td = document.createElement("td");
                    td.innerText=item.name;
                    tr.appendChild(td);

                    td = document.createElement("td");
                    td.innerText=item.remark;
                    tr.appendChild(td);

                    td = document.createElement("td");
                    td.innerText=item.createdTime;
                    tr.appendChild(td);


                    body.appendChild(tr);

                })


            });
    }
</script>
</body>
</html>